Event Handling

Catch Selected Index Changed Event in a Table Panel

Description
This customization shows how to catch a selected index changed event in a details table.
Variables
Record Control Class
Select the record control class of details table
Dropdown List Control
Select a Dropdown field in the details table that needs index changed event handler
Applies to
RecordControl class
Code
 
/// 
/// This method is called when a page is initialized.
///     
private void RecordControl_Load(object sender , System.EventArgs e)
{
    this.${Dropdown List Control}.AutoPostBack = true;
    this.${Dropdown List Control}.SelectedIndexChanged += new System.EventHandler(${Dropdown List Control}_SelectedIndexChanged);
}

 
Applies to
RecordControl class
Code
 
/// 
/// This sub handles the selected index changed event.
/// 
public void ${Dropdown List Control}_SelectedIndexChanged(object sender, System.EventArgs e) 
{ 
    
    //Add business logic here
}
     
Applies to
CSharpRecordControlConstructor class
Code
 
    // The following line will be inserted inside the
    // constructor for page class.    
    this.Load += new System.EventHandler(RecordControl_Load);
     

Terms of Service Privacy Statement